package com.region.plugin;

import com.region.plugin.proxy.ProxyHandler;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author 26225
 * @date 2024/9/7 13:04
 * @description
 */
public class ProxyTypeRegister {

    private static final Map<Class<? extends ProxyHandler>, ProxyHandler> proxyHandler = new ConcurrentHashMap<>();

    public static void registerProxyHandler(ProxyHandler abstractProxyHandler) {
        proxyHandler.putIfAbsent(abstractProxyHandler.getClass(), abstractProxyHandler);
    }

    protected static ProxyHandler getProxyHandler(Class<? extends ProxyHandler> clazz) {
        return proxyHandler.get(clazz);
    }

}
